<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/core/common/taglibs.jsp" %>
<%@ include file="/WEB-INF/core/common/top.jsp" %>
<script type="text/javascript" src="${ctx}/core/scripts/cal.js"></script>
<script language="javascript">
<!--
	function doAdd(){
		location.href="${ctx}/epgManage/channelManage.action?act=addInput&pageState=add";
	}

	function doEdit(id){
		location.href="${ctx}/epgManage/epgManage.action?act=editInput&programId="+id;
	}

	
	function doDelete(id) {
		if(confirm("<s:text name='delete.again.confirm'/>")) {
			location.href="${ctx}/epgManage/epgManage.action?act=delete&programId="+id;
		}
	}
	
   function sort(fieldName){
   		if(document.searchForm.sortField.value!=fieldName){
   			document.searchForm.sortMode.value="asc";
   		}else{
   			if('asc'=='<s:property value="sortMode"/>')
   				document.searchForm.sortMode.value="desc";
   			if('desc'=='<s:property value="sortMode"/>')
   				document.searchForm.sortMode.value="asc";
   		}
   		document.searchForm.sortField.value=fieldName;
   		document.searchForm.submit();
   }   
//-->
</script>
<body style="overflow-x:hidden;overflow-y:auto;">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<%@include file="/WEB-INF/core/common/message.jsp"  %>

  <tr>
    <td colspan="3" class="biaoge">	

     <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <form name="searchForm" method="post"  action="${ctx}/epgManage/epgManage.action">
      		<input type="hidden" name="act" value="query"/>
			<input type="hidden" name="sortField" value='<s:property value="sortField"/>'/>
			<input type="hidden" name="sortMode" value='<s:property value="sortMode"/>'/>	
			<input type="hidden" name="q_channelCode" value="<s:property value="q_channelCode"/>"/>
		<tr>
        <td height="10"></td>
      </tr>       
	  <tr>
		<!-- 查询条件 -->
	    <td class="tabulation" colspan="3"><div style="position:relative">
	      <div id="menu1"><img src="${ctx}/core/images/icon_13.gif"><s:text name="info.queryCondition" /></div>
	     
	        <table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF">
		        					
			        <tr align="left">
				         <td width="10%" bgcolor="#DDE4EA" nowrap="nowrap">&nbsp;&nbsp;<s:text name="program.name" /></td>
				        <td width="20%" bgcolor="#DDE4EA">
				            <exts:textfield id="q_name" name="q_name" value="%{q_name}" class="textbox_css" style="width:120px"/>
				        </td>
				         <td width="10%" bgcolor="#DDE4EA" nowrap="nowrap">&nbsp;&nbsp;<s:text name="program.status" /></td>
				        <td width="20%" bgcolor="#DDE4EA">
				        	<select name="q_status">
				            	<option value=""></option>
				            	<option value="1"><s:text name="label.valid" /></option>
				            	<option value="0"><s:text name="delete.ready" /></option>
				            	<option value="-2"><s:text name="deleting" /></option>
				            	<option value="-1"><s:text name="delete.failed" /></option>
				            	<option value="-3"><s:text name="delete.again" /></option>
				            </select>
				            <script>searchForm.q_status.value='<s:property value="q_status"/>'</script>
				        </td>				        
				    </tr> 
			        <tr align="left">
				        <td width="10%" bgcolor="#DDE4EA" nowrap="nowrap">&nbsp;&nbsp;<s:text name="program.date" /></td>
				        <td width="20%" bgcolor="#DDE4EA" colspan="3">
				            <exts:textfield id="q_startDate" name="q_startDate" value="%{q_startDate}" class="textbox_css" style="width:120px" readonly="true" onClick="setAppDay(this);"/>-
				            <exts:textfield id="q_endDate" name="q_endDate" value="%{q_endDate}" class="textbox_css" style="width:120px" readonly="true" onClick="setAppDay(this);"/>
				        </td>			        
				    </tr>				    
    		        <tr>
			        	<td height="20" colspan="4" align="right" bgcolor="#DDE4EA">
						   <input type="submit" class="btn" name="quary" value="<s:text name='button.query' />" />
				        </td>
			        </tr>		       
		       
			</table> </div></td>
	<!-- 查询条件结束 -->

  </tr>
   	<tr>
        <td height="5"></td>
      </tr>
      	</form>    
    </table>

      <table id="content" width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#A6A6A6">
        <tr bgcolor="#C7D6EA">
          <td width="10%" height="20" align="center" class="table_head"><s:text name="channel.code" /></td>
          <td width="20%" align="center" class="table_head"><s:text name="program.name" /></td>
          <td width="20%" align="center" class="table_head" ><s:text name="program.category" /></td>
          <td width="20%" align="center" class="table_head" ><a href="javascript:sort('START_TIME')"><s:text name="program.start.time" /></a><s:if test="sortField=='START_TIME'"><s:if test="sortMode=='asc'"><font color="red">↑</font></s:if><s:else><font color="red">↓</font></s:else></s:if></td>
          <td width="10%" align="center" class="table_head"><s:text name="program.duration" /></td>
          <td width="10%" align="center" class="table_head"><s:text name="program.status" /></td>
          <td width="10%" align="center" class="table_head"><s:text name="info.operate" /></td>
        </tr>
 		<s:iterator value="pageInfo.searchResult" id="it" status="st">
	        <tr>
	          <td height="20" align="center"><exts:property value="1"/></td>
	          <td align="center"><exts:property value="2"/></td>
	          <td align="center"><s:text name="%{#attr.it[3]}"/></td>
	          <td align="center"><exts:property value="4"/></td>
	          <td align="center"><exts:property value="5"/></td>
	          <td align="center"><s:if test="#it[6]==0"><s:text name="delete.ready" /></s:if><s:if test="#it[6]==1"><s:text name="label.valid" /></s:if><s:if test="#it[6]==-1"><s:text name="delete.failed" /></s:if><s:if test="#it[6]==-2"><s:text name="deleting" /></s:if><s:if test="#it[6]==-3"><s:text name="delete.again" /></s:if></td>
	          <td align="center">
	          	<table height="16" border="0" cellpadding="0" cellspacing="0">
	                <tr>
		                <s:if test="#it[6]==1&&#it[7]==1">
		                	<td width="22" align="right"><a href="javascript:doEdit('<exts:property value='0'/>')"><img src="${ctx}/core/images/edit.gif" name="icon_064" width="16" height="16" border="0" id="icon_064" style="CURSOR: hand" title="<s:text name='button.edit' />"/></a></td>
		                </s:if>
		                <s:elseif test="#it[6]==-1">
		                	<td width="22" align="right"><a href="javascript:doDelete('<exts:property value='0'/>')"><img src="${ctx}/core/images/del.gif" name="icon_064" width="16" height="16" border="0" id="icon_064" style="CURSOR: hand" title="<s:text name='button.delete' />"/></a></td>
		                </s:elseif>
		                <s:else>
		                	<td></td>
		                </s:else>
	                </tr>
	          	</table>
	          </td>
	        </tr>
	    </s:iterator>
	    
      </table>
      
      <!-- 分页 -->	  
		  <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr><td>${pagination}</td></tr>
          </table>
      <!-- 分页结束 -->	
    </td></tr></table>
</body>

<script>
	tables('content',null);
</script>